class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.v: B = None
        self.t: F = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.v: C = None
        self.r: E = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: A = None
        self.v: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

b = A("b")
n = B("n")
d = C("d")
l = D("l")
e = E("e")
j = F("j")
a = A("a")
g = B("g")
k = D("k")

b.y = k
b.r = k
b.v = n
b.t = j
b.w = d
n.w = l
n.p = l
n.q = g
n.v = d
n.r = e
d.z = k
d.r = b
d.v = b
l.y = g
l.r = k
e.t = l
j.x = b
a.y = l
a.r = k
a.v = g
a.t = j
a.w = d
g.w = l
g.q = n
g.v = d
g.r = e
g.p = k
k.y = n
k.r = l
assert b.w.v.t.x.t.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.v: B = None
        self.t: F = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.v: C = None
        self.r: E = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: A = None
        self.v: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

b = A("b")
n = B("n")
d = C("d")
l = D("l")
e = E("e")
j = F("j")
a = A("a")
g = B("g")
k = D("k")

b.y = k
b.r = k
b.v = n
b.t = j
b.w = d
n.w = l
n.p = l
n.q = g
n.v = d
n.r = e
d.z = k
d.r = b
d.v = b
l.y = g
l.r = k
e.t = l
j.x = b
a.y = l
a.r = k
a.v = g
a.t = j
a.w = d
g.w = l
g.q = n
g.v = d
g.r = e
g.p = k
k.y = n
k.r = l
assert b.w.v.t.x.t.x.t.txt == "j"