class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: D = None
        self.v: D = None
        self.z: A = None
        self.p: B = None
        self.txt = txt

b = A("b")
g = B("g")
h = C("h")
l = D("l")
m = E("m")
j = F("j")

b.r = m
b.w = m
b.y = g
g.y = l
h.w = g
h.q = b
l.p = m
l.z = g
m.t = b
m.x = g
j.x = m
j.u = l
j.v = l
j.z = b
j.p = g
assert j.z.r.t.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: D = None
        self.v: D = None
        self.z: A = None
        self.p: B = None
        self.txt = txt

b = A("b")
g = B("g")
h = C("h")
l = D("l")
m = E("m")
j = F("j")

b.r = m
b.w = m
b.y = g
g.y = l
h.w = g
h.q = b
l.p = m
l.z = g
m.t = b
m.x = g
j.x = m
j.u = l
j.v = l
j.z = b
j.p = g
assert j.z.r.t.w.x.txt == "g"