class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.s: E = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

h.y = b
h.s = b
h.v = c
h.x = g
h.p = l
j.y = h
c.q = h
c.u = j
g.p = b
g.o = j
b.x = h
l.z = j
l.w = b
assert b.x.s.x.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.s: E = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

h.y = b
h.s = b
h.v = c
h.x = g
h.p = l
j.y = h
c.q = h
c.u = j
g.p = b
g.o = j
b.x = h
l.z = j
l.w = b
assert b.x.s.x.v.q.txt == "h"