class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

j = A("j")
b = B("b")
f = C("f")
l = D("l")
c = E("c")
d = F("d")
i = F("i")

j.r = l
j.w = c
j.x = f
b.u = j
f.y = b
l.v = d
c.u = j
c.y = j
d.o = b
d.y = l
d.t = c
i.o = b
i.y = l
i.t = c
assert b.u.w.u.w.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

j = A("j")
b = B("b")
f = C("f")
l = D("l")
c = E("c")
d = F("d")
i = F("i")

j.r = l
j.w = c
j.x = f
b.u = j
f.y = b
l.v = d
c.u = j
c.y = j
d.o = b
d.y = l
d.t = c
i.o = b
i.y = l
i.t = c
assert b.u.w.u.w.y.x.y.txt == "b"